/*
 *@description: 工具方法
 *@Author:@reynold
 *@Date:2025-03-21 19:59:05
 *@Update:2025-03-21 19:59:05
 *@Version: V1.0.0
*/
import { Notification, Loading } from 'element-ui';
const utils = {
  // 存储token
  setToken(token) {
    localStorage.setItem('token', token)
  },
  // 获取token
  getToken() {
    return localStorage.getItem('token')
  },
  // 移除token
  removeToken() {
    const tk = this.getToken()
    if (tk) {
      localStorage.removeItem('token')
    }
  },

  // 消息提示
  showSuccess(msg) {
    Notification({
      title: '成功',
      message: msg,
      type: 'success'
    })
  },
  showWarning(msg) {
    Notification({
      title: '警告',
      message: msg,
      type: 'warning'
    })
  },
  showInfo(msg) {
    Notification({
      title: '提示',
      message: msg,
      type: 'info'
    })
  },
  // 开启loading
  showLoading(msg) {
    const loading = Loading.service({

    })
  }
}

// 导出utils 工具方法
export default utils